<?php
namespace app\common\command;

use app\common\lib\AMQP;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\console\input\Argument;
use think\console\input\Option;

/**
 * AMQP receive
 * Class AMQPReceive
 * @package app\common\command
 */
class AMQPReceive extends Command
{
    /**
     * 命令配置
     */
    protected function configure()
    {
        $this->setName('amqp:receive')
            ->setDescription('AMQP receive');
    }

    /**
     * 执行命令
     * @param Input $input
     * @param Output $output
     * @return int|void|null
     * @throws \think\Exception
     */
    protected function execute(Input $input, Output $output)
    {
//        $output->write('开始接收消息：' . date('Y-m-d H:i:s') . PHP_EOL);

        (new AMQP())->receive();
    }
}
